home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / text / print / post_min_186enh.lha / README! < prev    next >
Text File  |  1993-02-07  |  24KB  |  500 lines

  1. Postscript interpreter - README
  2. ===============================
  3.  
  4. Post V1.85enh Copyright © 1989, 1992 Adrian Aylward; user interface revision
  5.      by Robert Poole
  6.  
  7. Post V1.7 Copyright Adrian Aylward 1989, 1992
  8.  
  9. This distribution was released as the archive files "post17b.lzh" (binaries)
  10. and "post17s.lzh" (sources), 12-Mar-92
  11.  
  12. Binary files released in this distribution:
  13.  
  14. README            This file
  15. Post.info         Icon file
  16. post              User interface
  17. post.doc          Documentation file
  18. postband          Band printing driver
  19. postband.doc      Documentation file
  20. postlj            LaserJet printing driver
  21. postlj.doc        Documentation file
  22. post.library      Shared library for Amiga 500/1000/2000
  23. post.library.2620 Shared library for Amiga 2500/3000 (68020/030, 68881/2)
  24. init.ps           Standard postscript startup file
  25.  
  26. Font files:
  27.  
  28. FunkyFont         Tiny font, courtesy of Radical Eye software
  29. FunkyFont.afm     Metric file for the above
  30.  
  31. As of V1.8enh, the program Post no longer requires arp.library; however, some
  32. of its support files (most notably post.library and some of the binaries
  33. in the distribution) may rely on arp.library.  Since Amigados 1.3 support
  34. has been removed (R. Poole, 2/3/93), Conman is no longer required.
  35.  
  36. You should find arp.library on "All Good BBS's/disk libraries"
  37.  
  38. You will need at least a megabyte of memory.  Even with a megabyte you
  39. will have not be able to generate a full page in colour on the screen.
  40. For high density printer output (A4 at 300 dpi.) you will need 2 megabytes!  If memory is very tight, try running from the CLI, before workbench has
  41. been loaded.
  42.  
  43. Examples
  44. ========
  45.  
  46. There are some PostScript examples and demo programs that are being
  47. distributed separately, as they do not change from release to release.
  48. Look out for the file "psdemos1.lzh".
  49.  
  50. I (Robert Poole) have included a handful of examples of PostScript files
  51. which were originally part of the GhostScript distribution, and are covered
  52. under the GNU copyleft.
  53.  
  54. The PostScript Language
  55. =======================
  56.  
  57. If you don't know any PostScript I recomend obtaining a suitable tutorial
  58. book.  Try the "blue book" from Adobe:
  59.  
  60.     "PostScript Language Tutorial and Cookbook"
  61.     Adobe Systems Incorporated,
  62.     Addison-Wesley 1985, ISBN 0-201-10179-3
  63.  
  64. If you want to learn PostScript, Post is a valuable learning tool, as you
  65. run it interactively and view the output one the screen.  Without some basic
  66. knowledge you may find it difficult to understand what is happening if you
  67. have problems getting started.
  68.  
  69. Installation
  70. ============
  71.  
  72. Pre- 1.8enh:
  73. Make sure you have installed arp.library in your libs: directory.  You should
  74. also have ConMan installed if you are running under Workbench 1.3.  These
  75. packages are both freely available.  If you don't have them already any
  76. decent BBS or public domain disk library should have them.
  77.  
  78. Before using Post you will need to copy post.library into your libs:
  79. directory.  If you have an Amiga A3000, or an accelerator card with a 32 bit
  80. cpu (68020/030/040) and a floating point unit (68881/68882 or 68040) you can
  81. use the 2620 version of the library instead.  This is compiled to use
  82. hardware floating point instructions and runs about twice as fast.
  83. Otherwise you must use the standard library - if you try the 2620 version
  84. it will refuse to open.  If you have an earlier version of Post installed
  85. be sure to update the library.
  86.  
  87. To use FunkyFont, set up a directory "PSFonts:" and copy FunkyFont into it.
  88. Make a directory "PSFonts:afms" and then copy FunkyFont.afm into it.  (This
  89. file is not actually used by Post, but may be needed by other applications
  90. using FunkyFont).  If you want to make FunkyFont your default font, then edit
  91. the file "init.ps".  You need to comment out the line near the end that
  92. defines Courier as the default and uncomment the one that defines FunkyFont
  93. instead.  (In a PostScript source file a percent symbol ("%") means that
  94. the rest of the line is a comment.)  FunkyFont was written by Tomas Rokicki
  95. of Radical Eye Software; it is included by kind permission and is freely
  96. distributable.
  97.  
  98. (In version 1.8enh, I have modified init.ps to use FunkyFont as the default;
  99. I have also opted to include all the fonts from the GNU GhostScript package,
  100. all of which are either covered under GNU copyleft or are public domain.)
  101.  
  102. If you have any other PostScript fonts copy them into "PSFonts:" too.  (Do
  103. not confuse these with Amiga bitmapped fonts - these will NOT work, nor will
  104. .afm font metric files)  Their names should be the same as their PostScript
  105. names - e.g. "PSFonts:Times-Roman", "PSFonts:Times-Bold".  The files can
  106. either be ASCII text or in IBM PostScript font format.  If you have copied
  107. them from an IBM disk you will have to change the names; since MSDOS can only
  108. handle 8 character names its stores Times-Roman as "TI______.PFB" and
  109. Times-Bold as "TIB_____.PFB".  Then Post will load the fonts automatically
  110. as they are needed.
  111.  
  112. The startup file
  113. ================
  114.  
  115. The standard startup file "init.ps" should be run before most programs.  You
  116. should read it and the comments within it, as you may wish to customise it.
  117. It defines useful operators to mimic a standard PostScript printer.  It also
  118. handles automatic font downloading (see below).
  119.  
  120. Getting started
  121. ===============
  122.  
  123. Make sure that you have ConMan and the ARP library and you have installed
  124. Post as described above.
  125.  
  126. From the CLI you can just type "post init.ps screen", assuming that all the
  127. files are in the current directory.  You should see a new screen with a big
  128. requestor window appear.  Click on "OK" and wait while Post executes the
  129. startup file, then you are ready to go.
  130.  
  131. If it says that it can't get enough memory (if you have only 1 megabyte)
  132. try selecting "Black and White" on the requestor window, and selecting
  133. the "Close WBench" option.
  134.  
  135. For a quick check of the graphics, pick File/Interactive on the menu.  Then
  136. type into the narrow window at the top:
  137.  
  138.     200 200 150 0 360 arc stroke
  139.  
  140. The result should be a circle appearing in the lower window.
  141.  
  142. To erase the page type:
  143.  
  144.     erasepage
  145.  
  146. If you don't have any fonts yet all text output will just print as big dots.
  147. To make your text appear properly you need to set up a PSFonts: directory
  148. as described in the installation section.  To see if your fonts are working
  149. try:
  150.  
  151.     /FunkyFont findfont 20 scalefont setfont
  152.     10 10 moveto (Hello) show
  153.  
  154. To check your DefaultFont is set up properly try:
  155.  
  156.     /AnyFontYouDontHave findfont 20 scalefont setfont
  157.     10 30 moveto (This is the default font) show
  158.  
  159. When you have finished playing, type "quit".  Then "Project/Quit" will
  160. return you to the CLI.
  161.  
  162. To use the workbench startup click on the icon.  You will probably want to
  163. set up the tooltypes to execute the startup file "init.ps"; for now you can
  164. enter it in the requestor.
  165.  
  166. Fonts
  167. =====
  168.  
  169. As there are no fonts built in to the interpreter, all fonts must be loaded
  170. from the disk, as PostScript source.  The standard startup file redefines
  171. the findfont operator to automatically load fonts from the disk the first
  172. time they are referenced.  It first searches the directory "PSFonts:" for
  173. a file whose name is the same as the PostScript name (without the "/").  If
  174. it finds one it assumes it is a font definition and runs it.  Otherwise it
  175. tries the directory "PSFonts:OtherFonts".  (On my machine I keep all my Adobe
  176. fonts in PSFonts: and all my PD fonts in PSFonts:OtherFonts.)  You can change
  177. the list of directories to be searched by editing the startup file; you can
  178. also make it add a suffix to the font file names.
  179.  
  180. The startup file also defines a default font, which will be substituted if
  181. the font your program requests cannot be found.  The initial default font
  182. as set up by the standard startup file is a dummy font that just prints big
  183. dots.  It isn't readable, but at least allows most text operations to proceed
  184. without producing errors.  This means that if you don't have the font loading
  185. set up properly the only text output you will get is big dots.  So if that is
  186. what you see when you run Post it probably means that you don't have any
  187. fonts, rather than a problem with Post itself.
  188.  
  189. I have included a freely distributed font called "FunkyFont".  It is simple
  190. and takes up very little memory, but is quite readable.  If you don't have
  191. all the standard fonts it makes a useful default font.
  192.  
  193. Since a font is loaded into the vm just like any other PostScript code, it
  194. will be discarded when the vm is restored.  This means that in a multiple
  195. page document the fonts will likely be reloaded on every page.  To save time,
  196. it is usually much better to preload the fonts you are going to need.  You
  197. can do this using the "load font" menu command, or you can write yourself
  198. a little PostScript program to load your favourite fonts.  (Exercise for
  199. the user: write a driver to extract the font names from a conforming
  200. PostScript program and preload them.)
  201.  
  202. There are a number of commercial sources for fonts.  Both the Adobe type 1
  203. (encrypted) fonts and type 3 (standard downloadable) fonts are supported.
  204. Since type 1 fonts can contain special "hints" to improve the quality at
  205. small point sizes on low or medium resolution devices they usually give
  206. much higher quality results.  You can get type 1 fonts from Adobe, or a
  207. number of other vendors.
  208.  
  209. A good source of the standard set of 35 fonts as come on most PostScript
  210. printers is the Adobe Type Manager (13 fonts) and its associated Plus Pack
  211. (22 fonts).  The IBM version, for MS Windows, contains the fonts in a format
  212. which can be read by Post.  Various utility programs (e.g. CROSSDOS) are
  213. available to copy file from IBM 3.5 inch disks onto Amiga files.  Just copy
  214. the .PFB files into your PSFonts: directory, changing the names to their
  215. PostScript names. The Mac version contains the fonts too, but you need a
  216. utility program to change the file format.  The quality of the Adobe fonts
  217. is excellent; the printed output from Post on my LJIIP rivals that of a
  218. LaserWriter.
  219.  
  220. If you have any of the additional CompuGraphic outline fonts supplied by
  221. Gold Disk for use with their DTP programs you can generate type 3 fonts
  222. from them using their conversion program.  The quality is not as good as
  223. the original Compugraphic fonts but is acceptable for proofing purposes.
  224.  
  225. There are some freely copyable fonts that were originally distributed with
  226. the GhostScript project (another freeware PostScript interpreter available
  227. on Unix).  The quality of these is rather poor, as they appear to have been
  228. generated by tracing bitmap outlines.  However they will serve to get you
  229. started, and they are free.
  230.  
  231. There are also various shareware and PD fonts available.  Many of these were
  232. derived from the Mac or IBM.  They may still be in a foreign file format.
  233. The file should be converted to readable ASCII, with no strange control
  234. characters. Some of the fonts have Mac encoding vectors.  You won't notice
  235. the difference for the standard ASCII characters, as they are the
  236. same, but you may have to convert to the standard encoding to get
  237. more unusual characters like the trademark sign to work.  (Programs
  238. like Adobe illustrator do their own font encoding anyway.)  You
  239. will need to know some PostScript to make this change.  If you
  240. see the sequence "/Helvetica findfont /Encoding get" or
  241. "<dictionary> /MacVec get" try replacing it with "StandardEncoding".
  242.  
  243. You are recommended to ensure all your fonts have UniqueID's.  This makes
  244. the font caching code more efficient.  Often all you have to do is uncomment
  245. them in the source.  Any number will do for the ID (up to 2**24 - 1), as long
  246. as it is different for each of your fonts.  Make it a multiple of 4, as Adobe
  247. recommend adding 1 or 2 to the ID when modifying the font.
  248.  
  249. Each font should have a FontName entry.  This isn't actually required by
  250. Adobe, but certain programs such as Adobe Illustrator copy the font directory
  251. when recoding the font.  If the name is missing, you get a dictionary full
  252. error after the name has been added.
  253.  
  254. Common problems
  255. ===============
  256.  
  257. Printers
  258. --------
  259.  
  260. Some people have difficulty in getting Post to work correctly with printer
  261. output.  The first thing to check is that you have your printer preferences
  262. set up properly.  Post uses the printer values to set the size and density
  263. of its page buffer, so if you have silly values set it may pick a silly
  264. value for its buffer size and fail due to running out of memory.  So Run
  265. Preferences, go to the graphic 2 screen, and check the page limits.  If you
  266. set the limits to "Absolute" then width and height should be in inches; if
  267. you choose "Pixels" then the dimensions are in dots.  Turn smoothing and
  268. centering off.  On the graphic 1 screen, set the Aspect to horizontal, the
  269. image to positive, and the shade to black and white or colour according to
  270. your printer.  If the output comes out distorted, to a silly scale, or with
  271. circles turned into ellipses, and takes forether to print, it is probably
  272. because the page size is wrong and the printer device is laboriously scaling
  273. it to fit.  N.B. the WB 1.3 Preferences program appears to have a bug in it:
  274. after typing a value into the size gadgets you need to hit the return key;
  275. if you simply exit with the mouse teh value you typed gets lost.
  276.  
  277. If you are having problems with the printer setup, it is better to run Post
  278. interactively.  Then you can look at the values in the page size gadgets
  279. in the requestor window to check they are all sensible.
  280.  
  281. Most page printers (lasers, DeskJet) will give the best quality with density
  282. set to the highest value.  For matrix printers try both the highest and the
  283. next highest - as the pins usually overlap at high densities the quality may
  284. not be any better.  If you are very tight on memory then a lower density
  285. will reduce the amount needed for the page buffer.
  286.  
  287. The Workbench printer drivers print bitmapped graphics dumps within the
  288. text margins, whereas PostScript expects it bitmaps to begin right at the
  289. edges of the paper.  You can line things up properly by setting the page
  290. offset gadgets in the requestor window.  Once you have experimented to
  291. determine the proper values to can put them in a shell script, or set them
  292. in the WorkBench icon, so you don't have to type them every time.
  293.  
  294. If you have a LaserJet printer or one that emulates it, you should use the
  295. special driver "postlj".  It is faster, supports all the paper sizes in
  296. both portrait and landscape orientation, and avoids all the problems with
  297. the standard Workbench drivers interface.  I have tested it on my HP LJIIP,
  298. but it should work on other LaserJet compatibles.
  299.  
  300. If you attempt to print a page that is larger than the maximum graphics dump
  301. size that the driver will handle, it will be truncated rather than scaled to
  302. fit.  N.B. the Workbench 1.3 LaserJet and DeskJet drivers do not support
  303. dumps larger than 8 by 10 inches.
  304.  
  305. Fonts
  306. -----
  307.  
  308. Most of the remaining troubles relate to fonts.  There are many shareware
  309. fonts about. Normally these work. However being constructed slightly
  310. differently from the Adobe ones, they sometimes fail when programs attempt
  311. to modify them to change the character set encoding or character widths or
  312. obtain special effects. Also they may lack the hints; if so then they will
  313. not give good quality at small point sizes.
  314.  
  315. I personally recommend the Adobe fonts: the quality is excellent and you
  316. are assured of maximum compatability.  Just go and buy yourself a copy of
  317. Adobe Type manager for Windows.  It is not exactly expensive.
  318.  
  319. Other troubles with fonts usually relate to not not being able to find the
  320. font file on the disk.  Read the comments in the init.ps file to see
  321. what directories in your filing system it is searching, also check whether
  322. you font files have extensions.  I prefer to keep my fonts without
  323. extensions, so for example on my machine "Times-Roman" is in the file
  324. "PSFonts:Times-Roman".  But you may want to keep the ".PFB" extension on
  325. your font filesif they are in IBM format - if you have other packages that
  326. like them that way.  You can easily change this by editing init.ps.
  327.  
  328. N.B. if you have some files with ".AFM" extensions they are NOT PostScript
  329. fonts.  The are font metric files that define the character widths and other
  330. data for use by application programs; they do not define the characters
  331. outlines themselves.  They are of no use to Post.
  332.  
  333. Use with other packages
  334. -----------------------
  335.  
  336. I have used Post extensively with PPage (V2.0).  I find that printing using
  337. postlj is about five times faster than printing direct from PPage.  It solves
  338. the page offset problem.  Also, it gives access to the Adobe type 1 font
  339. range, which is considerably more extensive than the hinted versions of the
  340. Compugraphic fonts that are presently available.  There is a freely
  341. distributable package I have written, called "fmdtp", for adding PostScript
  342. fonts to PPage.
  343.  
  344. N.B. If you have the Helvetica-Narrow fonts (or if you don't have Helvetica)
  345. use the alternative prologue (alt_psprlg) so it won't waste time building
  346. them algorithmically (whether they are needed or not).
  347.  
  348. I have tested a PageStream file.  There was a problem with the prologue
  349. not being compatable with downloaded Adobe fonts.  If you load all your
  350. fonts beforehand, using the "Load font" menu selection, it should work OK.
  351. Hopefully this has been fixed by now.
  352.  
  353. I have printed Excellence! files successfully.
  354.  
  355. AmigaTeX with the PostScript driver also works OK.
  356.  
  357. Debugging
  358. ---------
  359.  
  360. If your PostScript program is failing, if you know a little PostScript
  361. is usually quit easy to find out what is going wrong.  In fact if you are
  362. developing PostScript code Post is a much better debugging tool than your
  363. average PostScript printer.
  364.  
  365. It is normally best to use interactive mode for debugging.  Start up Post
  366. on the screen and pick the "interactive" option.  Then run you program
  367. from the interactive window.
  368.  
  369. To run your program, type:
  370.  
  371.     > (filename.ps) run
  372.  
  373. If it fails with an error message, you can then type interactive commands
  374. to see what happened.
  375.  
  376. To display the contents of the operand stack, type:
  377.  
  378.     > pstack
  379.  
  380. To display the contents of the execution stack at the point of the last
  381. error, type:
  382.  
  383.     > $error /estack get ==
  384.  
  385. To display the contents of any named variable, type:
  386.  
  387.     > varname ==
  388.  
  389. To see what is in the current dictionary, type:
  390.  
  391.     > currentdict {== ==} forall
  392.  
  393. If you have no idea how far your program got before it failed, try adding a
  394. few lines "1001 ==" "1002 ==" "1003 ==" to trace how far it got.  As
  395. PostScript files are pure ASCII text they are easy to inspect any modify
  396. with any editor.
  397.  
  398. ------
  399.  
  400. Changes to 1.8enh:
  401.  
  402. All changes coded by me, Robert Poole.  Please email me at pooler@rpi.edu
  403. or pooler@cs.rpi.edu if you have any questions about the modifications I have
  404. made to Post.
  405.  
  406. * Amigados 1.3 compatibility has been nuked so that Post now conforms to
  407.   the look and feel of Amigados 2.0+.  All menus and gadgets are generated
  408.   by gadtools.library.  The ASL file requester is used in place of the ASL
  409.   file requester.  (Believe me, it looks a heck of a lot better.)
  410.  
  411. * Made the "Run File" option cause Post to temporarily change to the
  412.   directory where the file is located.  This allows Post to be able to find
  413.   any other auxiliary PostScript files in that directory.  (See the chess.ps
  414.   example file -- it calls cheq.ps.)
  415.  
  416. * There was a bug in the original Post 1.7 which caused the X and Y dpi
  417.   settings to not revert back to their correct values if you selected
  418.   printer output and then chose screen output.  Now, when you select the
  419.   printer as an output device, the X and Y dpi settings change to reflect
  420.   the printer's resolution, and when you select screen, they will revert
  421.   (properly) back to their default screen settings (75 dpi).
  422.  
  423. * The original Post 1.7 used the same number of colors for the screen
  424.   display as were available to the selected output device in the selected
  425.   color settings.  I.e., if you chose black and white, then Post 1.7 would
  426.   give you a 1 bitplane screen.  I have made Post 1.8enh give you a 16 color
  427.   screen by default.  This allows for a full-color user interface at all
  428.   times, which I find aesthetically pleasing.  If you select black and white
  429.   output, Post makes sure that color 0 is white and that color 1 is black;
  430.   everything else remains unchanged.  Big drawback: May cause you to run
  431.   out of chip RAM on older Amigas.
  432.  
  433. * I stated incorrectly in a previous preliminary release that Post had been
  434.   compiled with 68020+ optimization and assumed the presence of a FPU.  This
  435.   is not the case.  68020/030/881/882 optimization is really only relevant
  436.   to post.library, which I must revamp.  (See the to do list...)
  437.  
  438. * I have converted Post's C code to SAS/C 6.2 format, from the SAS/Lattice
  439.   5.1x format.  This should result in somewhat faster and tighter code.
  440.  
  441. * I changed the icon to conform to 2.0+ appearance.  :-)
  442.  
  443. * Lots of little modifications to the code to improve it (IMHO).  Look at
  444.   the source.
  445.  
  446. * Added a 2.0+ style version string to Post.  (I hope I have sufficiently
  447.   changed the version numbering scheme so as to satisfy the original
  448.   author's requirements as set forth in the LICENSE file.)
  449.  
  450. Changes to 1.85enh: (You can thank William Menninger for these!)
  451.  
  452. * At the suggestion of one user, added an extra checkbox gadget to the
  453.   requester window at startup which will allow users of sunmouse and
  454.   autopoint commodity programs to use Post without getting a headache.
  455.   Post normally likes to keep the focus on the interactive window, and the
  456.   autopoint utilities like to keep the focus on the window under the mouse
  457.   pointer, whichever that might be.  Naturally, this causes rapid switching
  458.   back and forth between the interactive window and the display window when
  459.   you are using both at the same time.  Now you can check this gadget at
  460.   startup and be guaranteed of peaceful coexistence.
  461.  
  462. * Another suggestion was to fix the redraw of the display window when the
  463.   interactive window is resized.  This is a bug that annoyed the crap out of
  464.   me in Post 1.7, and I am glad to be rid of it myself in Post 1.85enh.
  465.   Honestly, the bug fix is a total hack -- the code to handle the super
  466.   bitmap is not 100% kosher and doesn't even follow RKM guidelines, but to
  467.   do any more would require a complete rewrite of Post from the ground up.
  468.   Anyway, I think Mr. Aylward's method is a bit faster, albeit not
  469.   "correct."
  470.  
  471. Changes to 1.86enh:
  472.  
  473. * Fixed a bug of my own making.  This one is pretty minor, but I'm
  474.   embarrassed about it.  Turns out that my "fix" to the "Run file" menu
  475.   option had a major drawback -- if the file requester returned a directory
  476.   path that wasn't a FULL path (i.e., without the volume: at the beginning),
  477.   it would confuse Post.  My fix was simple, so now the "Run file" option
  478.   should work completely correctly, even when the file requester doesn't
  479.   return a full path including the volume name.  :-)
  480.  
  481. To do:
  482.  
  483. * Modify the remaining C source files to conform to SAS/C 6.x style, remove
  484.   1.3 compatibility hacks, remove ARP dependencies, etc.  I especially want
  485.   to optimize post.library.
  486.  
  487. * Bug: When you go into interactive mode, the first string that gets
  488.   printed into the interactive window says that you are using Post 1.7.
  489.   The routine that does this is located in post.library, I believe, and
  490.   so until I fix post.library to do the "right thing," you're stuck with
  491.   that message.  This isn't a bug so much as a reflection of the differen-
  492.   tial rate of change of the source files.  :-)
  493.  
  494. * Fix a couple of elusive bugs (not my doing!!! honest!!!)
  495.  
  496. * (Fill in your favorite suggestion here, and mail it to me.)
  497.  
  498. -- Robert Poole
  499. February 6, 1993
  500.